package org.gd.hellojaxb.privat24.deposits;

import org.gd.hellojaxb.adapters.DateAdaptersFactory;
import org.gd.hellojaxb.adapters.DoubleAdaptersFactory;

import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Date;

@XmlRootElement(name = "contract")
@XmlAccessorType(XmlAccessType.NONE)
public class Deposit {
    /**
     * наименование договоров
     */
    @XmlElement(name = "name")
    private String name;
    /**
     * дата старта договора
     */
    @XmlElement(name = "")
    @XmlJavaTypeAdapter(DateAdaptersFactory.StatementsDateFormat.class)
    private Date dateStart;
    /**
     * сумма по договору
     */
    @XmlElement(name = "summa")
    @XmlJavaTypeAdapter(DoubleAdaptersFactory.Amount.class)
    private Double amount;
    /**
     * валюта договора
     */
    @XmlElement(name = "cur")
    private String currency;
    /**
     * дата закрытия договора
     * TODO: parse to Date
     */
    @XmlElement(name = "date_close")
    private String dateClose;
    /**
     * признак где открыт
     */
    @XmlElement(name = "fiid")
    private String openPlace;
    /**
     * текущая % ставка по договору
     */
    @XmlElement(name = "percent")
    private Double percent;
    /**
     * статус договора(o - открыт)
     */
    @XmlElement(name = "state")
    private String state;
    /**
     * счет по договору
     */
    @XmlElement(name = "acc")
    private String account;

    public Deposit() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getDateStart() {
        return dateStart;
    }

    public void setDateStart(Date dateStart) {
        this.dateStart = dateStart;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public String getDateClose() {
        return dateClose;
    }

    public void setDateClose(String dateClose) {
        this.dateClose = dateClose;
    }

    public String getOpenPlace() {
        return openPlace;
    }

    public void setOpenPlace(String openPlace) {
        this.openPlace = openPlace;
    }

    public Double getPercent() {
        return percent;
    }

    public void setPercent(Double percent) {
        this.percent = percent;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }
}
